<%@page import="Entities.*"%>
<%@page import="Helpers.*"%>
<%@page import="Hibernate.*"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@include file="../../views/header.jsp" %>
<%@include file="../../views/mainMenu.jsp" %>
<%@include file="../../views/userMenu.jsp" %>
<%@include file="../../views/cntColumnOpen.jsp" %>

<h2>Bewerk cursussen</h2>
<p>Selecteer een cursus uit de droplist om de data op te halen en deze aan te passen</p>

   <%
     List<Cursussen> cursussen 		= chelper.getcursussen();
   %>
<form id="form6" name="form6" method="post" action="webpages/Cursus/showCursussen.jsp?s=1">
 <h4>
<select id="id" name="id" class="field select addr" onchange='this.form.submit()' tabindex="14" >
    <%
      String id = (String) request.getParameter("id");
      String s = (String) request.getParameter("s");

      //show form
      if (s == null) {
         id = "6";
      }

      for (Cursussen cursus : cursussen) {
          
	%>
                
               <option value="<%=cursus.getId() %>" <% if(cursus.getId()==Integer.parseInt(id)){ %>selected="selected"<%}      %>  ><%=cursus.getNaam()%></option><% }%>
</select>&nbsp;&nbsp;


<%
   if (session.getAttribute("rol").equals("3") )
    {
%>
      <a href="webpages/Cursus/addCursus.jsp"><img src="images/add.png" border="0" /></a>
      <a href="webpages/Cursus/deleteCursus.jsp?id=<%= Integer.parseInt(id) %>"><img src="images/delete.png" border="0" /></a>
<% } %>
      <a href="webpages/Cursus/showCursus.jsp?id=<%= Integer.parseInt(id) %>"><img src="images/edit.png" border="0" /></a> </h4>
  
</form>
<div id="sidebar">
    <div id="tab-set">
      <ul class='tabs'>
         <%
           Cursussen c = chelper.getCursus(Integer.parseInt(id));
         %>
        <li><a href='#text1'class='selected'>Omschrijving</a></li>
        <li><a href='#text2'>Hoofdstukken</a></li>
        <li><a href='#text3'>Toetsen</a></li>
        <li><a href='#text4'>Enquetes</a></li>
      </ul>
      <div id='text1'>              <div class="post">
      <img src="<%= c.getAfbeelding_url()%>" align="left" class="imgleft" width="120" /><%= c.getOmschrijving() %>
      </div>
      </div>
      <div id='text2'>
          <%@include file="../../webpages/Hoofdstukken/showHoofdstukken.jsp" %>  </div>
      <div id='text3'>
          <%@include file="../../webpages/Toetsen/showToetsen.jsp" %>     </div>
      <div id='text4'>
          <%@include file="../../webpages/Enquete/showEnquetes.jsp" %>
      </div>
    </div>
   
  </div>


<script type="text/javascript" src="includes/js/tabs.js"></script>


        <div class="fix"></div>
<!--/post-->

        <br class="fix" />

<%@include file="../../views/cntColumnRight.jsp" %>
<%@include file="../../views/footer.jsp" %>